#ifndef SVGPREVIEW_H
#define SVGPREVIEW_H

#include <QIcon>
#include <QWidget>

namespace Ui {
class SvgPreview;
}

class QsciScintilla;
class SvgPreview : public QWidget
{
    Q_OBJECT

public:
    explicit SvgPreview(QWidget *parent, QsciScintilla *pEdit);
    ~SvgPreview();


    QIcon iconFromSvgString(QSize size, const QByteArray &svgs);
    QPixmap pixmapFromIcon(QSize size, QIcon icon);

private:
    Ui::SvgPreview *ui;
    QsciScintilla *m_pEdit;
    QIcon m_icon;

    QSize s_defaultSize;

    // QWidget interface
protected:
    void resizeEvent(QResizeEvent *event) override;
};

#endif // SVGPREVIEW_H
